/**
 * public     公开的    可以在外部、子类、自身访问
 * protected  受保护的  不能在外部使用，只能在自身或子类中使用
 * private    私有的    只能在类自身方法中访问，不能在外部和子类中访问
 */
class Father{
    public name:string
    protected zupu:string
    private money:number
    constructor(name:string, zupu:string, money:number){
        this.name = name
        this.zupu = zupu
        this.money = money
    }
    say(){
        console.log('Father name: ', this.name)
        console.log('Father zupu: ', this.zupu)
        console.log('Father money: ', this.money)
    }
}

const f = new Father('老张', 'sadfsad', 2000)
// public 修饰的属性，可以在类的外部使用
// console.log(f.name)
// console.log(f.zupu)
// console.log(f.money)
f.say()

class Son extends Father{
    constructor(name:string, zupu:string, money:number){
        super(name, zupu, money)
    }
    hello(){
        console.log('Son name: ', this.name)
        console.log('Son zupu: ', this.zupu)
        // console.log('Son money: ', this.money)
    }
}

const s = new Son('小王', 'sdfjlsjd', 200)
s.hello()
